// audit state, added by regret
#include "burner.h"
#include "auditstate.h"

AuditState* auditState = NULL;

AuditState::AuditState()
	: state(NULL)
{
}

AuditState::~AuditState()
{
	delete [] state;
	state = NULL;
}

void AuditState::init()
{
	if (state) {
		return;
	}

	state = new char[BurnGetDrvCount()];
	reset();
}

void AuditState::reset()
{
	if (state) {
		memset(state, 0, BurnGetDrvCount());
	}
}

char AuditState::get(unsigned int id)
{
	if (id < BurnGetDrvCount()) {
		return state[id];
	}
	return AUDIT_FAIL;
}

void AuditState::set(unsigned int id, char val)
{
	if (id >= BurnGetDrvCount()) {
		return;
	}
	state[id] = val;
}
